package vivace.view;

import java.awt.*;
import java.awt.event.*;

import javax.swing.*;

import vivace.model.*;

public class NotationToolBar extends SelectionArea {
	
	/**
	 * 
	 */
	private static final long serialVersionUID = -2028217593980959558L;
	private Controller controller;
	
	public NotationToolBar() {
		controller = new Controller();
		
		Font font = new Font("Euterpe", Font.PLAIN, 14);
		
		setAlignmentY(Component.TOP_ALIGNMENT);
		setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
		
		ButtonGroup buttons = new ButtonGroup();
		
		// create whole note button
		JToggleButton wholeNoteButton = new JToggleButton(Note.WHOLE);
		wholeNoteButton.setFont(font);
		wholeNoteButton.addActionListener(controller);
		wholeNoteButton.setActionCommand("wholeNote");
		add(wholeNoteButton);
		buttons.add(wholeNoteButton);
		
		// create half note button
		JToggleButton halfNoteButton = new JToggleButton(Note.HALF);
		halfNoteButton.setFont(font);
		halfNoteButton.addActionListener(controller);
		halfNoteButton.setActionCommand("halfNote");
		add(halfNoteButton);
		buttons.add(halfNoteButton);
		
		// create fourth note button
		JToggleButton quarterNoteButton = new JToggleButton(Note.QUARTER);
		quarterNoteButton.setFont(font);
		quarterNoteButton.addActionListener(controller);
		quarterNoteButton.setActionCommand("quarterNote");
		add(quarterNoteButton);
		buttons.add(quarterNoteButton);
		
		// create eighth note button
		JToggleButton eighthNoteButton = new JToggleButton(Note.EIGHTH);
		eighthNoteButton.setFont(font);
		eighthNoteButton.addActionListener(controller);
		eighthNoteButton.setActionCommand("eighthNote");
		add(eighthNoteButton);
		buttons.add(eighthNoteButton);
		
		// create sixteenth note button
		JToggleButton sixteenthNoteButton = new JToggleButton(Note.SIXTEENTH);
		sixteenthNoteButton.setFont(font);
		sixteenthNoteButton.addActionListener(controller);
		sixteenthNoteButton.setActionCommand("sixteenthNote");
		add(sixteenthNoteButton);
		buttons.add(sixteenthNoteButton);
		
		// create half note button
		JToggleButton thirtysecondNoteButton = new JToggleButton(Note.THIRTYSECOND);
		thirtysecondNoteButton.setFont(font);
		thirtysecondNoteButton.addActionListener(controller);
		thirtysecondNoteButton.setActionCommand("thirtysecondNote");
		add(thirtysecondNoteButton);
		buttons.add(thirtysecondNoteButton);
		
		// create sixtyfourth note button
		/*JToggleButton sixtyfourthNoteButton = new JToggleButton(Note.SIXTYFOURTH);
		sixtyfourthNoteButton.setFont(font);
		sixtyfourthNoteButton.addActionListener(controller);
		sixtyfourthNoteButton.setActionCommand("sixtyfourthNote");
		add(sixtyfourthNoteButton);
		buttons.add(sixtyfourthNoteButton); */
		
		// create whole Pause button
		JToggleButton wholePauseButton = new JToggleButton(Pause.WHOLE);
		wholePauseButton.setFont(font);
		wholePauseButton.addActionListener(controller);
		wholePauseButton.setActionCommand("wholePause");
		add(wholePauseButton);
		buttons.add(wholePauseButton);
		
		// create half Pause button
		JToggleButton halfPauseButton = new JToggleButton(Pause.HALF);
		halfPauseButton.setFont(font);
		halfPauseButton.addActionListener(controller);
		halfPauseButton.setActionCommand("halfPause");
		add(halfPauseButton);
		buttons.add(halfPauseButton);
		
		// create fourth Pause button
		JToggleButton fourthPauseButton = new JToggleButton(Pause.QUARTER);
		fourthPauseButton.setFont(font);
		fourthPauseButton.addActionListener(controller);
		fourthPauseButton.setActionCommand("fourthPause");
		add(fourthPauseButton);
		buttons.add(fourthPauseButton);
		
		// create eighth Pause button
		JToggleButton eighthPauseButton = new JToggleButton(Pause.EIGHTH);
		eighthPauseButton.setFont(font);
		eighthPauseButton.addActionListener(controller);
		eighthPauseButton.setActionCommand("eighthPause");
		add(eighthPauseButton);
		buttons.add(eighthPauseButton);
		
		// create sixteenth Pause button
		JToggleButton sixteenthPauseButton = new JToggleButton(Pause.SIXTEENTH);
		sixteenthPauseButton.setFont(font);
		sixteenthPauseButton.addActionListener(controller);
		sixteenthPauseButton.setActionCommand("sixteenthPause");
		add(sixteenthPauseButton);
		buttons.add(sixteenthPauseButton);
		
		// create half Pause button
		JToggleButton thirtysecondPauseButton = new JToggleButton(Pause.THIRTYSECOND);
		thirtysecondPauseButton.setFont(font);
		thirtysecondPauseButton.addActionListener(controller);
		thirtysecondPauseButton.setActionCommand("thirtysecondPause");
		add(thirtysecondPauseButton);
		buttons.add(thirtysecondPauseButton);
		
		// create sixtyfourth Pause button
		/* JToggleButton sixtyfourthPauseButton = new JToggleButton(Pause.SIXTYFOURTH);
		sixtyfourthPauseButton.setFont(font);
		sixtyfourthPauseButton.addActionListener(controller);
		sixtyfourthPauseButton.setActionCommand("sixtyfourthPause");
		add(sixtyfourthPauseButton);
		buttons.add(sixtyfourthPauseButton); */
	
	}
	
	private class Controller implements ActionListener {

		public void actionPerformed(ActionEvent arg0) {
			// TODO Auto-generated method stub
			
		}
		
	}
}
